package com.jms.model.cms;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.jms.model.base.IdEntity;
import com.jms.model.sys.Tuser;

@Entity
@Table(name = "cms_news")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Tnews extends IdEntity implements java.io.Serializable {

	private String title;
	private String subtitle; 
	private String url; 
	private String content;
	private String description; 
	private String author; 
	private Integer weight;
	private Integer pagecount; 
	private Integer saveremoteimage;
	private String tags;
	private String source;
	private Integer status;
	private Tuser publishedby;
	private Date pubtime;
	private Tuser modifiedby;
	private Date modtime;
	private Tcate category;
	private Integer pv;
	private Integer allowcomment;
	private Integer comments;
	
	public Tnews() {
		super();
	}
		
	public Tnews(String title, String subtitle, String url, String content,
			String description, String author, Integer weight,
			Integer pagecount, Integer saveremoteimage,
			String tags, String source, Integer status, Tuser publishedby,
			Date pubtime, Tuser modifiedby, Date modtime, Tcate category,
			Integer pv, Integer allowcomment, Integer comments) {
		super();
		this.title = title;
		this.subtitle = subtitle;
		this.url = url;
		this.content = content;
		this.description = description;
		this.author = author;
		this.weight = weight;
		this.pagecount = pagecount;
		this.saveremoteimage = saveremoteimage;
		this.tags = tags;
		this.source = source;
		this.status = status;
		this.publishedby = publishedby;
		this.pubtime = pubtime;
		this.modifiedby = modifiedby;
		this.modtime = modtime;
		this.category = category;
		this.pv = pv;
		this.allowcomment = allowcomment;
		this.comments = comments;
	}


	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getSubtitle() {
		return subtitle;
	}
	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public Integer getWeight() {
		return weight;
	}
	public void setWeight(Integer weight) {
		this.weight = weight;
	}
	public Integer getPagecount() {
		return pagecount;
	}
	public void setPagecount(Integer pagecount) {
		this.pagecount = pagecount;
	}

	public Integer getSaveremoteimage() {
		return saveremoteimage;
	}
	public void setSaveremoteimage(Integer saveremoteimage) {
		this.saveremoteimage = saveremoteimage;
	}
	public String getTags() {
		return tags;
	}
	public void setTags(String tags) {
		this.tags = tags;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "publishedby")
	public Tuser getPublishedby() {
		return publishedby;
	}
	public void setPublishedby(Tuser publishedby) {
		this.publishedby = publishedby;
	}
	public Date getPubtime() {
		return pubtime;
	}
	public void setPubtime(Date pubtime) {
		this.pubtime = pubtime;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "modifiedby")
	public Tuser getModifiedby() {
		return modifiedby;
	}
	public void setModifiedby(Tuser modifiedby) {
		this.modifiedby = modifiedby;
	}
	public Date getModtime() {
		return modtime;
	}
	public void setModtime(Date modtime) {
		this.modtime = modtime;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "category_id")
	public Tcate getCategory() {
		return category;
	}

	public void setCategory(Tcate category) {
		this.category = category;
	}
	public Integer getPv() {
		return pv;
	}
	public void setPv(Integer pv) {
		this.pv = pv;
	}
	public Integer getAllowcomment() {
		return allowcomment;
	}
	public void setAllowcomment(Integer allowcomment) {
		this.allowcomment = allowcomment;
	}
	public Integer getComments() {
		return comments;
	}
	public void setComments(Integer comments) {
		this.comments = comments;
	}

	

}